package cn.oms.oms.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

@Data
@Accessors(chain = true)
public class UserReqVo implements Serializable {

    @ApiModelProperty(value = "用户ID")
    private Integer userId;

    //Spring Validation框架通过注解约束属性格式
    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty(value = "用户名")
    private String userName;

    @NotBlank(message = "昵称不能为空")
    @Pattern(regexp = "^.{2,20}$",message = "昵称是2到20个字符")
    @ApiModelProperty(value = "昵称")
    private String userNickName;

    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^\\w{6,20}$",message = "密码必须是6到20个数字,字母,_")
    @ApiModelProperty(value = "密码")
    private String userPassword;

    @NotNull(message = "用户类型不能是空")
    @ApiModelProperty(value = "用户类型")
    private Integer userType;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "删除标记")
    private Integer deleteFlag;

}
